package edu.sandau.f210153.f21010532.service;
import edu.sandau.f210153.f21010532.model.Orderingmeals;
import edu.sandau.f210153.f21010532.repository.OrderingmealsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.data.domain.Example;

import java.util.List;

@Component
public class OrderingmealsService {
    @Autowired
    private OrderingmealsRepository orderingmealRepository;
    public List<Orderingmeals> getAll(Orderingmeals orderingmeals){
        return orderingmealRepository.findAll(Example.of(orderingmeals));
    }
    public  void delete(Long Id){orderingmealRepository.deleteById(Id);
    }
    public  void save(Orderingmeals o){
        orderingmealRepository.save(o);
    }
    public Orderingmeals get(Long Id){
        return orderingmealRepository.getReferenceById(Id);
    }
}
